﻿using System;
using System.Runtime;
using System.Runtime.InteropServices;

namespace ToolSharp.Windows.Native
{
	[StructLayout(LayoutKind.Sequential)]
	public class MEMORYSTATUSEX
	{
		public int length;
		public int memoryLoad;
		public ulong totalPhys;
		public ulong availPhys;
		public ulong totalPageFile;
		public ulong availPageFile;
		public ulong totalVirtual;
		public ulong availVirtual;
		public ulong availExtendedVirtual;
		public MEMORYSTATUSEX()
		{
		}
	}

	[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
	public class OSVERSIONINFO
	{
		public int OSVersionInfoSize;
		public int MajorVersion;
		public int MinorVersion;
		public int BuildNumber;
		public int PlatformId;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x80)]
		public string CSDVersion;
		public OSVERSIONINFO()
		{
		}
	}

	[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
	public class OSVERSIONINFOEX
	{
		public int OSVersionInfoSize;
		public int MajorVersion;
		public int MinorVersion;
		public int BuildNumber;
		public int PlatformId;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x80)]
		public string CSDVersion;
		public ushort ServicePackMajor;
		public ushort ServicePackMinor;
		public short SuiteMask;
		public byte ProductType;
		public byte Reserved;
		public OSVERSIONINFOEX()
		{
		}
	}

	[StructLayout(LayoutKind.Sequential)]
	public class USEROBJECTFLAGS
	{
		public int fInherit;
		public int fReserved;
		public int dwFlags;
		[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
		public USEROBJECTFLAGS()
		{
		}
	}

	[Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto), BestFitMapping(false)]
	public class WIN32_FIND_DATA
	{
		public int dwFileAttributes;
		public uint ftCreationTime_dwLowDateTime;
		public uint ftCreationTime_dwHighDateTime;
		public uint ftLastAccessTime_dwLowDateTime;
		public uint ftLastAccessTime_dwHighDateTime;
		public uint ftLastWriteTime_dwLowDateTime;
		public uint ftLastWriteTime_dwHighDateTime;
		public int nFileSizeHigh;
		public int nFileSizeLow;
		public int dwReserved0;
		public int dwReserved1;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
		public string cFileName;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
		public string cAlternateFileName;
		[TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
		public WIN32_FIND_DATA()
		{
		}
	}
}
